﻿
CREATE FUNCTION dbo.Ver_MsgsToNumber
	(
	@Msg0 varchar(8000),
	@Msg1 varchar(8000),
	@Msg2 varchar(8000)
		
	)
RETURNS tinyint
AS
BEGIN

DECLARE @M0 int,@M1 int,@M2 int

SET @M0 = CASE WHEN ISNULL(@Msg0,'') > '' THEN 1 ELSE 0 END
SET @M1 = CASE WHEN ISNULL(@Msg1,'') > '' THEN 1 ELSE 0 END
SET @M2 = CASE WHEN ISNULL(@Msg2,'') > '' THEN 1 ELSE 0 END

RETURN @M0 + @M1*2 + @M2*4

END

